//
//  KLHomeBannerCell.m
//  Meboo
//
//  Created by kyo on 2023/12/25.
//

#import "KLHomeBannerCell.h"

@interface KLHomeBannerCell()


@end
@implementation KLHomeBannerCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        
        [self createSubView];
    }
    return self;
}

- (void) createSubView {
    self.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:255 / 255.0 blue:255 / 255.0 alpha:0];
    self.layer.cornerRadius = MBHeightScale(10);
    
    [self.contentView addSubview:self.imageView];
    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
    
    [self.contentView addSubview:self.titleLab];
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(MBWidthScale(15));
        make.bottom.mas_equalTo(MBHeightScale(-10));
    }];
}

#pragma mark -  懒加载
- (UIImageView *)imageView {
   if (!_imageView) {
       _imageView = [[UIImageView alloc] init];
       _imageView.layer.cornerRadius = MBHeightScale(10);
       _imageView.layer.masksToBounds = YES;
       _imageView.contentMode = UIViewContentModeScaleAspectFill;
//       _imageView.clipsToBounds = YES;
//       _imageView.image = ImageWithName(@"login_icon_self");
       [self.contentView addSubview:_imageView];
   }
   return _imageView;
}

- (UILabel *)titleLab {
    if (!_titleLab) {
        _titleLab = [UILabel new];
        _titleLab.textColor = UIColor.whiteColor;
        _titleLab.font = PDBoldScale(36);
    }
    return _titleLab;
}
@end
